//
//  EANavigationController.m
//  WhatToEat
//
//  Created by Mac on 15/3/21.
//  Copyright (c) 2015年 Mac. All rights reserved.
//

#import "EANavigationController.h"

@implementation EANavigationController
- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}









- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.tintColor=[UIColor whiteColor];
    
    self.navigationBar.backgroundColor = [UIColor clearColor];
    self.navigationBar.barTintColor = [UIColor whiteColor];
    
    
    [[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]];

    
    
    self.navigationBar.tintColor=[UIColor whiteColor];
    
    
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    backBtn.frame = CGRectMake(0, 0, 44, 44);
    
    [backBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
//    [backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
    self.navigationItem.leftBarButtonItem = backItem;
    
    [self.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                [UIColor whiteColor], UITextAttributeTextColor,
                                                [UIColor whiteColor], UITextAttributeTextShadowColor,
                                                [NSValue valueWithUIOffset:UIOffsetMake(0, 0)], UITextAttributeTextShadowOffset,
                                                kNavigationTitleFont, UITextAttributeFont,
                                                nil]];
}


-(void)viewWillAppear:(BOOL)animated
{

    [super viewWillAppear:animated];


    
}

-(void)backAction
{

    [self popViewControllerAnimated:YES];
    

}
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{


//    navigationController.navigationItem.backBarButtonItem
    
    
    
    

}

@end
